from django.db import models

# Create your models here.

class Images(models.Model):
    title=models.CharField(max_length=12)
    # img_url=models.ImageField(upload_to='upload')
    #添加到数据库 imagefield会导致数据类型冲突需要手动重写
    img_url=models.CharField(max_length=150)
    link=models.CharField(max_length=150)
    class Meta:
        db_table='images'
    def __str__(self):
        return self.title

class Address(models.Model):
    name=models.CharField(max_length=12,blank=True)
    city=models.CharField(max_length=12)
    qu=models.CharField(max_length=12)
    number=models.ForeignKey('self',related_name='numbers',null=True,blank=True,on_delete=models.CASCADE)
    my=models.ForeignKey('self',related_name='aaa',null=True,blank=True,on_delete=models.CASCADE)

    class Meta:
        db_table='address'

